{% macro gen_table(prices) %}
    <table id="price-table" class="table table-bordered table-hover table-condensed table-striped">
        <thead>
            <tr>
                <th>产品类型</th>
                <th>产品名称</th>
                <th>品牌</th>
                <th>参数</th>
                <th>数量</th>
                <th>单价</th>
                <th>总价</th>
            </tr>
        </thead>
        <tbody>
            {% for item in prices %}
                {% if item %}
                    <tr>
                        <td>{{ item.product_type }}</td>
                        <td>{{ item.product_name or ''}}</td>
                        <td>{{ item.brand }}</td>
                        <td>{{ item.spec or '' }}</td>
                        <td>{{ item.quantity or 0 }}</td>
                        <td>{{ '%.2f' % item.price }}</td>
                        <td>{{ '%.2f' % item.total }}</td>
                    </tr>
                {% endif %}
            {% endfor %}
        </tbody>
    </table>
{% endmacro %}